-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
many: delay classic registration until first store interaction #4873
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4873 +/- ##
==========================================
+ Coverage 79.11% 79.13% +0.02%
==========================================
Files 478 478
Lines 35491 35606 +115
==========================================
+ Hits 28079 28178 +99
- Misses 5192 5199 +7
- Partials 2220 2229 +9
Continue to review full report at Codecov.
|
overlord/devicestate/devicemgr.go
Outdated
return nil | ||
} | ||
|
||
// waitForRegistrationTimeout is the timeout after which waitForRegistration will give up, about the same as network retries max timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you wrap the comment?
overlord/devicestate/devicemgr.go
Outdated
// on classic the first time around we just do | ||
// prepare-device + key gen and then pause the process | ||
// until the first store interaction | ||
full = err != state.ErrNoState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick, but I find this easier to read when scanning though the code:
if err == state.ErrNoState {
full = false
}
ee1b28e
to
59a7d5b
Compare
…via devicestate for a serial, tweak comments
…ensuring we are registered
…state auto-refresh logic based on whether we are registered or not or we should proceed anyway
9191d59
to
c66d35c
Compare
@@ -105,6 +130,19 @@ func (m *DeviceManager) markRegistered() { | |||
close(m.reg) | |||
} | |||
|
|||
func (m *DeviceManager) markRegistrationFirstAttempt() { | |||
if m.registrationFirstAttempted { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be covered by a mutex or use atomic compare and swap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's always called with the state lock taken, otoh this PR is super likely to get closed soon
closing this as discussed with Bret |
XXX UPDATE:
fakestore as well (but it's a larger change because it doesn't support the session endpoints yet and
could be done in a follow up)